﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VerbrauchProcessor.DatabaseAccess.DataModel;

namespace DataAnalyzer
{
	/// <summary>
	/// 
	/// </summary>
	public class AverageValues
	{
		/// <summary>
		/// 
		/// </summary>
		public decimal WaterAverage { get; private set; }

		/// <summary>
		/// 
		/// </summary>
		public decimal ElectricityAverage { get; private set; }
		/// <summary>

		/// 
		/// </summary>
		public decimal GasAverage { get; private set; }

		/// <summary>
		/// 
		/// </summary>
		public AverageValues(IList<MeasurementIntervall> mis)
		{

			mis.ToList<MeasurementIntervall>().ForEach(mi =>
			{
				WaterAverage += mi.WaterPerDay_m3;
				ElectricityAverage += mi.ElectricityPerDay_kwh;
				GasAverage += mi.GasPerDay_m3;
			});

			WaterAverage /= mis.Count;
			ElectricityAverage /= mis.Count;
			GasAverage /= mis.Count;
		}
	}
}
